/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package be.khk.lesson;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Jeroen
 */
@Entity
@Table(name = "boeking")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Boeking.findAll", query = "SELECT b FROM Boeking b"),
    @NamedQuery(name = "Boeking.findById", query = "SELECT b FROM Boeking b WHERE b.id = :id"),
    @NamedQuery(name = "Boeking.findByBoekingsdatum", query = "SELECT b FROM Boeking b WHERE b.boekingsdatum = :boekingsdatum"),
    @NamedQuery(name = "Boeking.findByAantalReizigers", query = "SELECT b FROM Boeking b WHERE b.aantalReizigers = :aantalReizigers"),
    @NamedQuery(name = "Boeking.findByKlantID", query = "SELECT b FROM Boeking b WHERE b.klantId = :klantId")})
public class Boeking implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Column(name = "Boekingsdatum")
    @Temporal(TemporalType.DATE)
    private Date boekingsdatum;
    @Basic(optional = false)
    @NotNull
    @Column(name = "AantalReizigers")
    private int aantalReizigers;
    @JoinColumn(name = "BetaalMethodeID", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private Betaalmethode betaalMethodeID;
    @JoinColumn(name = "KlantId", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private Klant klantId;
    @JoinColumn(name = "ReisID", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private Reis reisID;

    public Boeking() {
    }

    public Boeking(Integer id) {
        this.id = id;
    }

    public Boeking(Integer id, Date boekingsdatum, int aantalReizigers) {
        this.id = id;
        this.boekingsdatum = boekingsdatum;
        this.aantalReizigers = aantalReizigers;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getBoekingsdatum() {
        return boekingsdatum;
    }

    public void setBoekingsdatum(Date boekingsdatum) {
        this.boekingsdatum = boekingsdatum;
    }

    public int getAantalReizigers() {
        return aantalReizigers;
    }

    public void setAantalReizigers(int aantalReizigers) {
        this.aantalReizigers = aantalReizigers;
    }

    public Betaalmethode getBetaalMethodeID() {
        return betaalMethodeID;
    }

    public void setBetaalMethodeID(Betaalmethode betaalMethodeID) {
        this.betaalMethodeID = betaalMethodeID;
    }

    public Klant getKlantId() {
        return klantId;
    }

    public void setKlantId(Klant klantId) {
        this.klantId = klantId;
    }

    public Reis getReisID() {
        return reisID;
    }

    public void setReisID(Reis reisID) {
        this.reisID = reisID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Boeking)) {
            return false;
        }
        Boeking other = (Boeking) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "be.khk.lesson.Boeking[ id=" + id + " ]";
    }
    
}
